<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>List of Keys and Mouse/Joystick Buttons for Hotkeys and Macros</title>
<meta name="description" content="These are the keyboard keys, mouse buttons, and joystick buttons that can be used to create hotkeys and macros.">
<meta name="keywords" content="keyboard,keys,key,mouse,buttons,button,joystick,create,hotkeys,hotkey,macros">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="static/theme.css" rel="stylesheet" type="text/css" />
<script src="static/content.js" type="text/javascript"></script>
<style type="text/css">
table.nested {
	border-collapse: collapse;
	width: 100%;
	margin-bottom: 0;
}
table.nested td {
	border-top: 0;
	border-bottom: 0;
}
table.nested td.l {
	border-left: 0;
	width: 10em;
	min-width: 10em;
}
table.nested td.r {
	border-right: 0;
}
</style>
</head>
<body>
<h1>List of Keys, Mouse Buttons, and Joystick Controls</h1>
<h2>Mouse</h2>
<table class="info">
  <tr>
    <th>General</th>
    <th><br></th>
  </tr>
  <tr>
    <td>LButton</td>
    <td>Left mouse button</td>
  </tr>
  <tr>
    <td>RButton</td>
    <td>Right mouse button</td>
  </tr>
  <tr>
    <td>MButton</td>
    <td>Middle or wheel mouse button</td>
  </tr>
  <tr>
    <th>Advanced</th>
    <th><br></th>
  </tr>
  <tr>
    <td>XButton1</td>
    <td>4th mouse button. Typically performs the same function as Browser_Back.</td>
  </tr>
  <tr>
    <td>XButton2</td>
    <td>5th mouse button. Typically performs the same function as Browser_Forward.</td>
  </tr>
  <tr>
    <th>Wheel</th>
    <th><br></th>
  </tr>
  <tr>
    <td>WheelDown</td>
    <td>Turn the wheel downward (toward you).</td>
  </tr>
  <tr>
    <td>WheelUp</td>
    <td>Turn the wheel upward (away from you).</td>
  </tr>
  <tr>
    <td>WheelLeft<br>WheelRight</td>
    <td><p><span class="ver">[v1.0.48+]:</span> Scroll to the left or right.</p>
    <p>Requires Windows Vista or later. These can be used as hotkeys with some (but not all) mice which have a second wheel or support tilting the wheel to either side. In some cases, software bundled with the mouse must instead be used to control this feature. Regardless of the particular mouse, <a href="commands/Send.htm">Send</a> and <a href="commands/Click.htm">Click</a> can be used to scroll horizontally in programs which support it.</p></td>
  </tr>
</table>
<h2>Keyboard</h2>
<p><strong>Note: The names of the letter and number keys are the same as that single letter or digit. For example: b is the &quot;b&quot; key and 5 is the &quot;5&quot; key.</strong></p>
<table class="info">
  <tr>
    <th>General</th>
    <th><br></th>
  </tr>
  <tr>
    <td>CapsLock</td>
    <td>Caps lock</td>
  </tr>
  <tr>
    <td>Space</td>
    <td>Space bar</td>
  </tr>
  <tr>
    <td>Tab</td>
    <td>Tab key</td>
  </tr>
  <tr>
    <td>Enter (or Return)</td>
    <td>Enter key</td>
  </tr>
  <tr>
    <td>Escape (or Esc)</td>
    <td>Esc key</td>
  </tr>
  <tr>
    <td>Backspace (or BS)</td>
    <td>Backspace</td>
  </tr>
  <tr>
    <th style="white-space: nowrap;">Cursor Control</th>
    <th><br></th>
  </tr>
  <tr>
    <td>ScrollLock</td>
    <td>Scroll lock</td>
  </tr>
  <tr>
    <td>Delete (or Del)</td>
    <td>Delete key</td>
  </tr>
  <tr>
    <td>Insert (or Ins)</td>
    <td>Insert key</td>
  </tr>
  <tr>
    <td>Home</td>
    <td>Home key</td>
  </tr>
  <tr>
    <td>End</td>
    <td>End key</td>
  </tr>
  <tr>
    <td>PgUp</td>
    <td>Page Up key</td>
  </tr>
  <tr>
    <td>PgDn</td>
    <td>Page Down key</td>
  </tr>
  <tr>
    <td>Up</td>
    <td>Up arrow key</td>
  </tr>
  <tr>
    <td>Down</td>
    <td>Down arrow key</td>
  </tr>
  <tr>
    <td>Left</td>
    <td>Left arrow key</td>
  </tr>
  <tr>
    <td>Right</td>
    <td>Right arrow key</td>
  </tr>
  <tr>
    <th>Numpad</th>
    <th><br></th>
  </tr>
  <tr>
    <td><strong>NumLock ON</strong></td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l"><strong>NumLock OFF</strong></td>
          <td class="r"><br></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad0</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadIns</td>
          <td class="r">0 / Insert key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad1</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadEnd</td>
          <td class="r">1 / End key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad2</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadDown</td>
          <td class="r">2 / Down arrow key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad3</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadPgDn</td>
          <td class="r">3 / Page Down key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad4</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadLeft</td>
          <td class="r">4 / Left arrow key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad5</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadClear</td>
          <td class="r">5 / typically does nothing</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad6</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadRight</td>
          <td class="r">6 / Right arrow key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad7</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadHome</td>
          <td class="r">7 / Home key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad8</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadUp</td>
          <td class="r">8 / Up arrow key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>Numpad9</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadPgUp</td>
          <td class="r">9 / Page Up key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>NumpadDot</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadDel</td>
          <td class="r">Decimal separation / Delete key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>NumpadDiv</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadDiv</td>
          <td class="r">Divide</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>NumpadMult</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadMult</td>
          <td class="r">Multiply</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>NumpadAdd</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadAdd</td>
          <td class="r">Add</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>NumpadSub</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadSub</td>
          <td class="r">Subtract</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td>NumpadEnter</td>
    <td style="padding: 0;"><table class="nested">
        <tr>
          <td class="l">NumpadEnter</td>
          <td class="r">Enter key</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <th>Function</th>
    <th><br></th>
  </tr>
  <tr>
    <td>F1 - F24</td>
    <td>The 12 or more function keys at the top of most keyboards.</td>
  </tr>
  <tr>
    <th>Modifier</th>
    <th><br></th>
  </tr>
  <tr>
    <td>LWin</td>
    <td>Left Windows logo key. Corresponds to the <code>&lt;#</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>RWin</td>
    <td>Right Windows logo key. Corresponds to the <code>&gt;#</code> hotkey prefix.<br>Note: Unlike Control/Alt/Shift, there is no generic/neutral &quot;Win&quot; key because the OS does not support it. However, hotkeys with the <code>#</code> modifier can be triggered by either Win key.</td>
  </tr>
  <tr>
    <td>Control (or Ctrl)</td>
    <td>Control key. As a hotkey (<code>Control::</code>) it fires upon release unless it has the tilde prefix. Corresponds to the <code>^</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>Alt</td>
    <td>Alt key. As a hotkey (<code>Alt::</code>) it fires upon release unless it has the tilde prefix. Corresponds to the <code>!</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>Shift</td>
    <td>Shift key. As a hotkey (<code>Shift::</code>) it fires upon release unless it has the tilde prefix. Corresponds to the <code>+</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>LControl (or LCtrl)</td>
    <td>Left Control key. Corresponds to the <code>&lt;^</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>RControl (or RCtrl)</td>
    <td>Right Control key. Corresponds to the <code>&gt;^</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>LShift</td>
    <td>Left Shift key. Corresponds to the <code>&lt;+</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>RShift</td>
    <td>Right Shift key. Corresponds to the <code>&gt;+</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>LAlt</td>
    <td>Left Alt key. Corresponds to the <code>&lt;!</code> hotkey prefix.</td>
  </tr>
  <tr>
    <td>RAlt</td>
    <td>Right Alt key. Corresponds to the <code>&gt;!</code> hotkey prefix.<br>Note: If your keyboard layout has AltGr instead of RAlt, you can probably use it as a hotkey prefix via <code>&lt;^&gt;!</code> as described <a href="Hotkeys.htm#AltGr">here</a>. In addition, <code>LControl &amp; RAlt::</code> would make AltGr itself into a hotkey.</td>
  </tr>
  <tr>
    <th>Multimedia</th>
    <th><br></th>
  </tr>
  <tr>
    <td>Browser_Back</td>
    <td>Back</td>
  </tr>
  <tr>
    <td>Browser_Forward</td>
    <td>Forward</td>
  </tr>
  <tr>
    <td>Browser_Refresh</td>
    <td>Refresh</td>
  </tr>
  <tr>
    <td>Browser_Stop</td>
    <td>Stop</td>
  </tr>
  <tr>
    <td>Browser_Search</td>
    <td>Search</td>
  </tr>
  <tr>
    <td>Browser_Favorites</td>
    <td>Favorites</td>
  </tr>
  <tr>
    <td>Browser_Home</td>
    <td>Homepage</td>
  </tr>
  <tr>
    <td>Volume_Mute</td>
    <td>Mute the volume</td>
  </tr>
  <tr>
    <td>Volume_Down</td>
    <td>Lower the volume</td>
  </tr>
  <tr>
    <td>Volume_Up</td>
    <td>Increase the volume</td>
  </tr>
  <tr>
    <td>Media_Next</td>
    <td>Next Track</td>
  </tr>
  <tr>
    <td>Media_Prev</td>
    <td>Previous Track</td>
  </tr>
  <tr>
    <td>Media_Stop</td>
    <td>Stop</td>
  </tr>
  <tr>
    <td>Media_Play_Pause</td>
    <td>Play/Pause</td>
  </tr>
  <tr>
    <td>Launch_Mail</td>
    <td>Launch default e-mail program</td>
  </tr>
  <tr>
    <td>Launch_Media</td>
    <td>Launch default media player</td>
  </tr>
  <tr>
    <td>Launch_App1</td>
    <td>Launch My Computer</td>
  </tr>
  <tr>
    <td>Launch_App2</td>
    <td>Launch Calculator</td>
  </tr>
  <tr>
    <td colspan="2"><strong>Note:</strong> The function assigned to each of the keys listed above can be overridden by modifying the Windows registry. This table shows the default function of each key on most versions of Windows.</td>
  </tr>
  <tr>
    <th>Special</th>
    <th><br></th>
  </tr>
  <tr>
    <td>AppsKey</td>
    <td>Menu key. This is the key that invokes the right-click context menu.</td>
  </tr>
  <tr>
    <td>PrintScreen</td>
    <td>Print screen</td>
  </tr>
  <tr>
    <td>CtrlBreak</td>
    <td><br></td>
  </tr>
  <tr>
    <td>Pause</td>
    <td>Pause key</td>
  </tr>
  <tr>
    <td>Break</td>
    <td>Break key. Since this is synonymous with Pause, use <code>^CtrlBreak</code> in hotkeys instead of <code>^Pause</code> or <code>^Break</code>.</td>
  </tr>
  <tr>
    <td>Help</td>
    <td>Help key. This probably doesn't exist on most keyboards. It's usually not the same as F1.</td>
  </tr>
  <tr>
    <td>Sleep</td>
    <td>Sleep key. Note that the sleep key on some keyboards might not work with this.</td>
  </tr>
  <tr>
    <td>SC<b>nnn</b></td>
    <td>Specify for <b>nnn</b> the scan code of a key. Recognizes unusual keys not mentioned above. See <a href="#SpecialKeys">Special Keys</a> for details.</td>
  </tr>
  <tr>
    <td id="vk">VK<b>nn</b></td>
    <td>Specify for <b>nn</b> the hexadecimal virtual key code of a key. This rarely-used method also prevents certain types of <a href="Hotkeys.htm">hotkeys</a> from requiring the <a href="commands/_InstallKeybdHook.htm">keyboard hook</a>. For example, the following hotkey does not use the keyboard hook, but as a side-effect it is triggered by pressing <em>either</em> Home or NumpadHome:
      <pre>^VK24::MsgBox You pressed Home or NumpadHome while holding down Control.
</pre>
      <strong>Known limitation:</strong> VK hotkeys that are forced to use the <a href="commands/_InstallKeybdHook.htm">keyboard hook</a>, such as <code>*VK24</code> or <code>~VK24</code>, will fire for only one of the keys, not both (e.g. NumpadHome but not Home).
      For more information about the VKnn method, see <a href="#SpecialKeys">Special Keys</a>.</td>
  </tr>
</table>
<h2 id="Joystick">Joystick</h2>
<p><strong>Joy1 through Joy32</strong>: The buttons of the joystick. To help determine the button numbers for your joystick, use this <a href="scripts/JoystickTest.htm">test script</a>. Note that <a href="Hotkeys.htm">hotkey prefix symbols</a> such as ^ (control) and + (shift) are not supported (though <a href="commands/GetKeyState.htm">GetKeyState</a> can be used as a substitute). Also note that the pressing of joystick buttons always &quot;passes through&quot; to the active window if that window is designed to detect the pressing of joystick buttons.</p>
<p>Although the following Joystick control names cannot be used as hotkeys, they can be used with <a href="commands/GetKeyState.htm">GetKeyState</a>:<br>
  <strong>JoyX, JoyY, and JoyZ</strong>: The X (horizontal), Y (vertical), and Z (altitude/depth) axes of the joystick.<br>
  <strong>JoyR</strong>: The rudder or 4th axis of the joystick. <br>
  <strong>JoyU and JoyV</strong>: The 5th and 6th axes of the joystick. <br>
  <strong>JoyPOV</strong>: The point-of-view (hat) control.<br>
  <strong>JoyName</strong>: The name of the joystick or its driver. <br>
  <strong>JoyButtons</strong>: The number of buttons supported by the joystick (not always accurate). <br>
  <strong>JoyAxes</strong>: The number of axes supported by the joystick.<br>
  <strong>JoyInfo</strong>: Provides a string consisting of zero or more of the following letters to indicate the joystick's capabilities: <strong>Z</strong> (has Z axis), <strong>R</strong> (has R axis), <strong>U</strong> (has U axis), <strong>V</strong> (has V axis), <strong>P</strong> (has POV control), <strong>D</strong> (the POV control has a limited number of discrete/distinct settings), <strong>C</strong> (the POV control is continous/fine). Example string: ZRUVPD</p>
<p><strong>Multiple Joysticks</strong>: If the computer has more than one joystick and you want to use one beyond the first, include the joystick number (max 16) in front of the control name. For example, 2joy1 is the second joystick's first button.</p>
<p><strong>Note</strong>: If you have trouble getting a script to recognize your joystick, one person reported needing to specify a joystick number other than 1 even though  only a single joystick was present. It is unclear how this situation arises or whether it is normal, but experimenting with the joystick number in the <a href="scripts/JoystickTest.htm">joystick test script</a> can help determine if this applies to your system.</p>
<p><strong>See Also</strong>:<br>
<a href="misc/RemapJoystick.htm">Joystick remapping:</a> methods of sending keystrokes and mouse clicks with a joystick.<br>
<a href="scripts/JoystickMouse.htm">Joystick-To-Mouse script</a>: using a joystick as a mouse.</p>
<h2>Hand-held Remote Controls</h2>
<p>Respond to signals from hand-held remote controls via the <a href="scripts/WinLIRC.htm">WinLIRC client script</a>.</p>
<h2 id="SpecialKeys">Special Keys</h2>
<p>If your keyboard or mouse has a key not listed above, you might still be able to make it a hotkey by using the following steps:</p>
<ol>
  <li>Ensure that at least one script is running that is using the <a href="commands/_InstallKeybdHook.htm">keyboard hook</a>. You can tell if a script has the keyboard hook by opening its main window and selecting &quot;View-&gt;Key history&quot; from the menu bar.</li>
  <li>Double-click that script's tray icon to open its main window.</li>
  <li>Press one of the &quot;mystery keys&quot; on your keyboard.</li>
  <li>Select the menu item &quot;View-&gt;Key history&quot;</li>
  <li>Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE: Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access. For possible solutions, see further below.</li>
  <li>If your key is detectible, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. <strong>159</strong>).</li>
  <li>To define this key as a hotkey, follow this example:
<pre><strong>SC159::</strong> <em>; Replace 159 with your key's value.</em>
MsgBox, %A_ThisHotKey% was pressed.
return</pre></li>
</ol>
<p><strong>Reverse direction</strong>: To remap some other key to <em>become</em> a &quot;mystery key&quot;, follow this example:</p>
<pre><em>; Replace 159 with the value discovered above. Replace FF (if needed) with the
; key's virtual key, which can be discovered in the first column of the Key History screen.</em>
#c::<a href="commands/Send.htm#vk">Send {vkFFsc159}</a></pre>
<p><strong>Alternate solutions</strong>: If your key or mouse button is not detectible by the Key History screen, one of the following might help:</p>
<ol>
  <li>
    <p>Reconfigure the software that came with your mouse or keyboard (sometimes accessible in the Control Panel or Start Menu) to have the &quot;mystery key&quot; send some other keystroke. Such a keystroke can then be defined as a hotkey in a script. For example, if you configure a mystery key to send Control+F1, you can then indirectly make that key as a hotkey by using <code>^F1::</code> in a script.</p>
  </li>
  <li>
    <p>Try <a href="http://www.autohotkey.com/forum/topic6367.html">DllCall: Support for Human Interface Devices</a>. You can also try searching the <a href="http://www.autohotkey.com/forum/">forum</a> for a keyword like RawInput*.</p>
  </li>
  <li>
    <p>The following is a last resort and generally should be attempted only in desperation. This is because the chance of success is low and it may cause unwanted side-effects that are difficult to undo:<br>
      Disable or remove any extra software that came with your keyboard or mouse or change its driver to a more standard one such as the one built into the OS. This assumes there is such a driver for your particular keyboard or mouse and that you can live without the features provided by its custom driver and software.</p>
  </li>
</ol>
</body>
</html>
